feat: more engine fix ports#24
Merged
Merged
Conversation
… Grid Scrap - Muzzle Flash Light: detour MuzzleFlash::UpdateLight to call SetAppCulled on the attached NiPointLight when the flash ends. Concept from WallSoGB/Fallout-Muzzle-Flash-Fix. - Hi-Res Bloom: pattern-scan BSShaderRenderTargets::Create and rewrite the hardcoded shr-by-2 imm8 per nBloomScale (1=full, 2=half, 4=vanilla, 8=eighth). Concept from WallSoGB/Fallout-High-Res-Bloom. Opt-in default. - Alt-Tab Fullscreen: IAT-detour D3D11CreateDeviceAndSwapChain, install MakeWindowAssociation(NO_WINDOW_CHANGES|NO_ALT_ENTER), chain a WndProc via SetWindowLongPtrA that drops exclusive fullscreen on focus loss. - Power Grid Scrap: hook TESObjectREFR::SetWantsDelete; if the deleted ref is workshop-linked and present in the workshop's powerGrid (V1170 IsItemPresentInWorkshop check), call Workshop::DeleteWorkshopItem before the original SetWantsDelete proceeds. Concept from SUP F4SE V1170 by Tomm (MIT). Bumps commonlibf4 to fix/inline-powerutils-helpers (PR #8 upstream); needed because two TUs now include RE/P/PowerUtils.h transitively.
OG 1.10.163 imports wcsrtombs_s from MSVCR110.dll, not from api-ms-win-crt-convert-l1-1-0.dll which is the modern CRT api-set used by NG/AE. The IAT detour now walks both DLL names so the hook installs on all three runtimes.
Adds bAnimSignedCrash, bBethesdaNetCrash, bMuzzleFlashLight, bAltTabFullscreen, bPowerGridScrap, bHighResBloom and nBloomScale to the known-keys allowlist so SettingStore stops emitting 'unknown key' warnings for them.
PR #8 (inline ItemIsPowerConnection / ItemIsPowerReceiver) was merged into commonlibf4 main; track the merged SHA so the feature branch can be deleted.
… Fix - DPI Scaling: preload-stage shim calling SetProcessDpiAwarenessContext (PMv2) with fallback cascade to SetProcessDpiAwareness and SetProcessDpiAware. No address-library binding required. Opt-in (bDpiScaling = false) since many users already apply the OS compat-tab shim manually. - Animated Static Reload: vtable[0x9D] detour on TESObjectREFR::ShouldSaveAnimationOnSaving (RE::VTABLE::TESObjectREFR[0]). Forces save when base is BGSMovableStatic and an active NiControllerSequence is in kAnimating + kLoop. Restores the engine's animation state across save/load (Diamond City fans, settlement generators, etc.). Concept ported from SKSE Animated Static Reload (max-su-2019 / doodlum). - Viewmodel Shading: detour DrawWorld::Move1stPersonToOrigin (OG addrlib 76526, NG/AE 2318293), post-add BSShaderManager::State::forwardLightOffset to BSShaderAccumulator::eyePosition. Corrects specular highlights on the first-person viewmodel. Concept ported from WallSoGB Viewmodel Shading Fix (NVSE). Player-attached-light mirror fix (NV 0x87513F) is a follow-up. - DoF Fix: detour ImageSpaceManager::RenderEffect worker (OG addrlib 325252, NG/AE 2316595) with a runtime-branched signature (OG passes the effect pointer in rdx, NG/AE pass an index into effectList._data). Filter on ImageSpaceEffectDepthOfField vtable; after vanilla DoF runs, re-issue the first-person viewmodel via BSShaderUtil::RenderScene (OG 1310228, NG/AE 2317576) so the viewmodel stays sharp through DoF. Concept ported from WallSoGB Fallout-DoF-Fix (NVSE).
Detours BGSDistantObjectBlock::Prepare (OG addrlib 950871, NG/AE 2213394), walks children of the prepared block, and forces kSpecular on each BSGeometry's shade-slot property via BSShaderProperty::SetFlag (OG 1251793, NG/AE 2316281). Pre-state gate skips re-walk on already-prepared blocks. Re-enables specular sampling on distant-object LODs so they no longer look flat. Default opt-in (bLODSpecular = false) because FOLIP-generated LOD packs bake specular into the diffuse and would double-bright with the engine fix. Coexistence shape pending answer from FOLIP author. Concept ported from WallSoGB Fallout-LOD-Fixes sub-fix #1 (NVSE).
This reverts commit 510afad.
Conflicts resolved: - AdConfigValidation: union of our keys + master's bUtilityShader; added bPipBoyCursorConstraints (missing on master). - AdRegisterModules: union of our 10 modules + master's UtilityShader and PipBoyCursorConstraints. Kept AnimSignedCrash/BethesdaNetCrash registered (this branch ships the OG MSVCR110.dll fallback fix that addresses what prompted master's comment-out). - VC/Addictol.vcxproj + .filters: union of file lists. - .Build/F4SE/Plugins/Addictol.toml: re-added bAnimSignedCrash and bBethesdaNetCrash keys with default false, matching master's opt-in stance pending cross-runtime smoke test (PR #24). - Depends/commonlibf4: took master's 23aa504e (descendant of our ec2bf96e; includes PR #8 inline fix plus 4 more commits). - Version files: took master's; pre-build script will regenerate.
Reverses master hotfix 4d09f9d's opt-in defaults for AnimSignedCrash and BethesdaNetCrash; this branch ships the OG MSVCR110.dll fallback (807a497) that addressed the original failure. DpiScaling's install path no-ops via ACCESS_DENIED if an OS compat-tab DPI shim already locked awareness, so default-on is safe alongside the manual shim.
…x-ports # Conflicts: # .Build/F4SE/Plugins/Addictol.toml # Addictol/Source/AdConfigValidation.cpp # Addictol/Source/AdRegisterModules.cpp
The previous approach subclassed the engine WndProc and called SetFullscreenState(FALSE) on focus loss, but never restored fullscreen on focus gain. After alt-tab back, the swap chain was windowed while the engine believed it was still in exclusive mode, causing a permanent black-screen lockup on the render thread. Switch to the same approach used by SSE Engine Fixes / Display Tweaks: at D3D11CreateDeviceAndSwapChain, force Windowed=TRUE and clear ALLOW_MODE_SWITCH whenever the engine requested exclusive. Keep MakeWindowAssociation(NO_WINDOW_CHANGES | NO_ALT_ENTER) so DXGI cannot promote us back into exclusive on Alt+Enter. Drop the WndProc subclass and all g_swapChain/g_hwnd/g_origWndProc state.
Collapse 4 explainer blocks (AltTabFullscreen, ViewmodelShading, DofFix x2) to one line each. Removes restated rationale and 'before this change' framing; keeps the non-obvious WHY.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NiPointLightwhen a muzzle flash ends so disabled flashes stop leaking illumination.shrinBSShaderRenderTargets::Createso the bloom RT can render at full/half/quarter/eighth res vianBloomScale. Opt-in.Workshop::DeleteWorkshopItemso orphan power-grid entries don't survive into a recycled FormID.PER_MONITOR_AWARE_V2early so non-100% Windows scaling doesn't blur the UI.MSVCR110.dllwhen the CRT shim DLL isn't in the IAT.bAnimSignedCrash/bBethesdaNetCrash) so SettingStore stops emitting "unknown key" warnings.Depends/commonlibf4bumped to track main HEAD (commonlibf4#8 merged:inlineonItemIsPowerConnection/ItemIsPowerReceiverso two TUs can includeRE/P/PowerUtils.hwithout LNK2005).